<%@ page import="cn.bai.mvc.Customer" %><%--
  Created by IntelliJ IDEA.
  User: Admin
  Date: 12/24 0024
  Time: 14:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<c:if test="${requestScope.message !=null}">
    <br>
    <font color="red">${requestScope.message}</font>
    <br>
</c:if>
<c:set var="id" value="${cutomer !=null ? customer.id:param.id}"></c:set>
<c:set var="name" value="${cutomer !=null ? customer.name:param.oldName}"></c:set>
<c:set var="oldName" value="${cutomer !=null ? customer.name:param.oldName}"></c:set>
<c:set var="address" value="${cutomer !=null ? customer.address:param.address}"></c:set>
<c:set var="phone" value="${cutomer !=null ? customer.phone:param.phone}"></c:set>

    <form action="update.do" method="post">
        <input type="hidden" name="id" value="${id}">
        <input type="hidden" name="oldName" value="${oldName}">
        <table>
            <tr>
                <td>Name:</td>
                <td><input type="text" name="name" value="${name}"></td>
            </tr>
            <tr>
                <td>Address:</td>
                <td><input type="text" name="address" value="${address}"></td>
            </tr>
            <tr>
                <td>Phone:</td>
                <td><input type="text" name="phone" value="${phone}"></td>
            </tr>
            <tr>
                <td colspan="2"><input type="submit" value="Submit"/></td>
            </tr>
        </table>
    </form>
</body>
</html>
